package com.aistar.hotel.mapper;


import com.aistar.hotel.entity.RoomDetails;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;


/**
 * Created by wubin on 2019/6/23.
 */
public interface RoomDetailsMapper {

    @Select("select * from roomdetails where hotelroom_name like room_breakfast('%',#{room_breakfast},'%')")
    List<RoomDetails> findAll(String roomname);

    @Select("select * from roomdetails where room_id=#{id}")
    RoomDetails findById(String id);

    @Insert("insert into roomdetails values(#{roomId},#{roomBreakfast},#{roomWindows},#{roomBedstyle},#{roomWifi})")
    void save(RoomDetails roomDetails);

    @Delete("delete from roomdetails where room_id=#{id}")
    void delete(String id);

    @Update("update roomdetails set room_breakfast=#{roomBreakfast},room_windows=#{roomWindows} where room_id=#{roomId}")
    void update(RoomDetails roomDetails);
}
